package com.lmt.api;

import com.lmt.base.ResultData;
import com.lmt.entity.search.ResourceEsSearch;
import com.lmt.service.ResourceEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Date 2018/07/17
 *
 * @author MT-Lin
 */
@RestController
@RequestMapping("/ResourceEsApi")
public class ResourceEsApi {

	private final ResourceEsService resourceEsService;

	@Autowired
	public ResourceEsApi(ResourceEsService resourceEsService) {
		this.resourceEsService = resourceEsService;
	}

	@RequestMapping("/searchFromEs")
	public ResultData searchFromEs(@RequestBody ResourceEsSearch resourceEsSearch) {
		return this.resourceEsService.searchFromEs(resourceEsSearch);
	}
}
